<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		<div id="app">
			初始列表:
			<ul>
				<li v-for="n in names" v-once>{{n}}</li>
			</ul>
			最新列表:			
			<ul>
				<li v-for="n in names">{{n}}</li>
			</ul>
			<input type="text" v-model="name"/>
			<button @click="add">添加</button>
		</div>
		
		<script>
			var app = Vue.createApp({
				data() {
					return {
						name:'',
						names:['张三','李四','王五']
					}
				},
				methods:{
					add:function(){
						this.names.push(this.name)
					}
				}
			});
			var vm = app.mount("#app")
		</script>



	</body>
</html>